home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / htttrack / httrack-3.41-3.exe / {app} / src / htstools.h < prev    next >
C/C++ Source or Header  |  2006-08-15  |  4KB  |  117 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. Please visit our Website: http://www.httrack.com
  29. */
  30.  
  31.  
  32. /* ------------------------------------------------------------ */
  33. /* File: httrack.c subroutines:                                 */
  34. /*       various tools (filename analyzing ..)                  */
  35. /* Author: Xavier Roche                                         */
  36. /* ------------------------------------------------------------ */
  37.  
  38.  
  39. #ifndef HTSTOOLS_DEFH
  40. #define HTSTOOLS_DEFH 
  41.  
  42. /* specific definitions */
  43. #include "htsglobal.h"
  44.  
  45. /* Forward definitions */
  46. #ifndef HTS_DEF_FWSTRUCT_httrackp
  47. #define HTS_DEF_FWSTRUCT_httrackp
  48. typedef struct httrackp httrackp;
  49. #endif
  50. #ifndef HTS_DEF_FWSTRUCT_find_handle_struct
  51. #define HTS_DEF_FWSTRUCT_find_handle_struct
  52. typedef struct find_handle_struct find_handle_struct;
  53. typedef find_handle_struct* find_handle;
  54. #endif
  55.  
  56. /* Library internal definictions */
  57. #ifdef HTS_INTERNAL_BYTECODE
  58. int ident_url_relatif(const char *lien, const char* urladr, const char* urlfil, char* adr, char* fil);
  59. int lienrelatif(char* s,const char* link,const char* curr);
  60. int link_has_authority(const char* lien);
  61. int link_has_authorization(const char* lien);
  62. void long_to_83(int mode,char* n83,char* save);
  63. void longfile_to_83(int mode,char* n83,char* save);
  64. HTS_INLINE int __rech_tageq(const char* adr,const char* s);
  65. HTS_INLINE int __rech_tageqbegdigits(const char* adr,const char* s);
  66. HTS_INLINE int rech_tageq_all(const char* adr, const char* s);
  67. #define rech_tageq(adr,s) \
  68.   ( \
  69.     ( (*((adr)-1)=='<') || (is_space(*((adr)-1))) ) ? \
  70.     ( \
  71.       (streql(*(adr),*(s))) ?   \
  72.       (__rech_tageq((adr),(s))) \
  73.       : 0                       \
  74.     ) \
  75.     : 0\
  76.   )
  77. #define rech_tageqbegdigits(adr,s) \
  78.   ( \
  79.     ( (*((adr)-1)=='<') || (is_space(*((adr)-1))) ) ? \
  80.     ( \
  81.       (streql(*(adr),*(s))) ?   \
  82.       (__rech_tageqbegdigits((adr),(s))) \
  83.       : 0                       \
  84.     ) \
  85.     : 0\
  86.   )
  87. //HTS_INLINE int rech_tageq(const char* adr,const char* s);
  88. HTS_INLINE int rech_sampletag(const char* adr,const char* s);
  89. HTS_INLINE int rech_endtoken(const char* adr, const char** start);
  90. HTS_INLINE int check_tag(char* from,const char* tag);
  91. int verif_backblue(httrackp* opt, const char* base);
  92. int verif_external(httrackp *opt,int nb,int test);
  93.  
  94. int istoobig(httrackp *opt,LLint size,LLint maxhtml,LLint maxnhtml,char* type);
  95. HTSEXT_API int hts_buildtopindex(httrackp* opt,const char* path,const char* binpath);
  96.  
  97. // Portable directory find functions
  98. // Directory find functions
  99. HTSEXT_API find_handle hts_findfirst(char* path);
  100. HTSEXT_API int hts_findnext(find_handle find);
  101. HTSEXT_API int hts_findclose(find_handle find);
  102. //
  103. HTSEXT_API char* hts_findgetname(find_handle find);
  104. HTSEXT_API int hts_findgetsize(find_handle find);
  105. HTSEXT_API int hts_findisdir(find_handle find);
  106. HTSEXT_API int hts_findisfile(find_handle find);
  107. HTSEXT_API int hts_findissystem(find_handle find);
  108.  
  109. #ifndef HTTRACK_DEFLIB
  110. HTSEXT_API char* hts_getcategory(const char* filename);
  111. HTSEXT_API char* hts_getcategories(char* path, int type);
  112. #endif
  113.  
  114. #endif
  115.  
  116. #endif
  117.